void drawDancer(pt P, float w, Boolean r) { // shows dancer in 2D at P with orientation w standing on right foot when r
  pushMatrix();
  translate(P.x, P.y);
  rotate(w);
  pushMatrix(); 
  scale(.4, 1); 
  ellipse(0, 0, 100, 100); 
  popMatrix();
  ellipse(0, 0, 20, 20); // supporting foot
  pushMatrix(); 
  if (r) translate(0, 30); 
  else translate(0, -30); 
  scale(.2, .2); 
  ellipse(0, 0, 100, 100); 
  popMatrix(); // other foot
  pushMatrix(); 
  translate(5, 0); 
  scale(.45, .35); 
  ellipse(0, 0, 100, 100); 
  popMatrix(); // head
  popMatrix();
}

void drawDancer3D(pt P, float w, Boolean r) { // shows dancer in 3D at P with orientation w standing on right foot when r
  pushMatrix();
  translate(P.x, P.y, 50); 
  rotate(w); // align body
  pushMatrix(); 
  scale(.4, .6, 1); 
  sphere(50); 
  popMatrix(); // body
  pushMatrix(); 
  translate(0, 0, -100); 
  scale(.25, .1, .1); 
  sphere(50); 
  popMatrix(); // supporting foot
  pushMatrix(); 
  if (r) translate(0, 30, -100); 
  else translate(0, -30, -100); 
  scale(.25, .1, .1); 
  sphere(50); 
  popMatrix(); // other foot
  pushMatrix(); 
  translate(10, 0, 65); 
  scale(.35, .35, .50);  
  sphere(50);  
  popMatrix(); // head
  popMatrix();
}


void drawInter(pt P, float w){
  pushMatrix();
  translate(P.x, P.y);
  rotate(w);
  pushMatrix(); 
  scale(.4, 1); 
  ellipse(0, 0, 100, 100); 
  popMatrix();
  popMatrix();  
}

void drawDancerAni(pt P, float w) { // shows dancer in 2D at P with orientation w standing on right foot when r
  pushMatrix();
  translate(P.x, P.y);
  rotate(w);
  pushMatrix(); 
  scale(.4, 1); 
  ellipse(0, 0, 100, 100); 
  popMatrix();
  pushMatrix(); 
  translate(5, 0); 
  scale(.45, .35); 
  ellipse(0, 0, 100, 100); 
  popMatrix(); // head
  popMatrix();
}

void drawFeetAni(pt P, float w,Boolean r){
  pushMatrix();
  translate(P.x, P.y);
   rotate(w);
  if (r) translate(0, 30); 
  else translate(0, -30); 
  ellipse(0, 0, 20, 20); // supporting foot

  popMatrix(); // other foot
}

